﻿@using EasyMvcBlog.DTO
@using Webdiyer.WebControls.Mvc;
@model PagedList<SoftwareUseDTO>
 
@section Scripts
{
  <script type="text/javascript">
      $("#softwareName").change(function () {
          var software = $(this).val();
          self.location = "/Admin/SoftwareStatistics/1?softwareName=" + software;
      });

  </script>
}

@using(Html.BeginForm("SoftwareStatistics","Admin",FormMethod.Get))
{
<div class="content-box">
    <div class="content-box-header">
        <span>软件使用分析统计</span>
    </div>
    <div class="content-box-content">
    <div>
       @Html.DropDownList("softwareName", ViewBag.SoftwareNameList as List<SelectListItem>)
       今日使用人数：@ViewBag.TodayCount
    </div>
        <table class="easyShowTable" width="100%" style="margin-bottom: 20px;">
            <thead>
                <tr>
                    <th>
                        软件名
                    </th>
                    <th>
                        用户Mac标志
                    </th>
                    <th>
                        用户名称
                    </th>
                    <th>
                        上次使用时间
                    </th>
                    <th>
                        使用次数
                    </th>
                </tr>
            </thead>
            @foreach (SoftwareUseDTO softwareUseDto in Model)
            {
                <tr>
                    <td>
                        @softwareUseDto.SoftwareName
                    </td>
                    <td>
                        @softwareUseDto.ComputerMac
                    </td>
                    <td>
                        @softwareUseDto.ComputerName
                    </td>
                    <td>
                        @softwareUseDto.LastUseTime
                    </td>
                    <td>
                        @softwareUseDto.TotalUseCount
                    </td>
                </tr>
            }
        </table>
       @Html.Pager(Model, new PagerOptions
       {
           PageIndexParameterName = "id",
           CurrentPagerItemWrapperFormatString = "<span class=\"cpb\">{0}</span>",
           NumericPagerItemWrapperFormatString = "<span class=\"item\">{0}</span>",
           ShowPageIndexBox = false,
           ShowMorePagerItems = true,
           ShowFirstLast = true,
           NumericPagerItemCount = 8,
           PageIndexBoxWrapperFormatString = "go to {0}",
           GoToPageSectionWrapperFormatString = "<span class=\"gotoPage\">{0}</span>",
           CssClass = "pages",
           SeparatorHtml = "",
           HorizontalAlign="right"
       })
    </div>
</div>
}
